<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/pages/templates/template.xhtml">
	<ui:define name="title">
		<h:outputText value="#{msgImpl.lblImplementacion}" />
	</ui:define>
	<ui:define name="content">
		<f:loadBundle basename="i18n.messages" var="msg" />
		<f:loadBundle basename="i18n.msg-implementation" var="msgImpl" />
		<h:form id="formImplementacion">
			<p:growl id="growl" showDetail="true" sticky="true" />  
			<p:panel header="#{msgImpl.lblProyecto}" id="pnlProyecto">
				<div align="center">
				<p:outputLabel value="#{implementationUI.proyecto.nombre}" />
				</div>
			</p:panel>
			<p:panel header="#{msgImpl.lblImplementacion}" id="pnlImplementacion">
				<h:panelGrid columns="2">
					<p:outputLabel value="#{msgImpl.lblImplementacion}"/>
					<p:inputText maxlength="50" value="#{implementationUI.implementacion.nombre}"/>
					
					<p:outputLabel value="#{msgImpl.lblCategoria}"/>
					<p:selectCheckboxMenu value="#{implementationUI.listCategoriasSelect}" 
						label="#{msgImpl.lblCategoria}" filter="true" filterText="Filter" 
							filterMatchMode="startsWith">  
				        <f:selectItems value="#{implementationUI.listCategorias}" />  
				    </p:selectCheckboxMenu>  
				</h:panelGrid>
				<h:panelGrid >
						<p:outputLabel value="#{msgImpl.lblObservacion}" />
						<p:inputTextarea value="#{implementationUI.implementacion.observacion}"
							cols="100" maxlength="200" rows="3" />
					</h:panelGrid>
			</p:panel>
			<p:fieldset>
				<div align="center" >
					<p:commandButton value="#{msgImpl.btnGuardar}" action="#{implementationUI.actionGuardar}" 
						process="@form" update="@form"/>
					<p:commandButton value="#{msgImpl.btnLimpiar}" action="#{implementationUI.actionLimpiar}" 
						process="@form" update="@form"/>
					<p:commandButton value="#{msgImpl.btnRegresar}" action="#{implementationUI.actionRegresar}"/>
				</div>
			</p:fieldset>
			<p:fieldset>
				<p:dataTable value="#{implementationUI.data}" paginator="true" var="row"
					id="dataTableCabecera"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} ">
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{msgImpl.lblImplementacion}" />
						</f:facet>
						<h:outputText value="#{row.nombre}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{msgImpl.lblCategoria}" />
						</f:facet>
						<p:dataList value="#{row.listImplementacionCategorias}" var="cat" itemType="disc">
							 #{cat.nombreCategoria} 
						</p:dataList> 
					</p:column>
				</p:dataTable>	
			</p:fieldset>
		</h:form>
	</ui:define>
</ui:composition>
</html>